<html>
<head><meta charset="utf-8"><title>Generator functions vs blocks · wg-async-foundations/stream-trait-rfc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/249502-wg-async-foundations/stream-trait-rfc/index.html">wg-async-foundations/stream-trait-rfc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/249502-wg-async-foundations/stream-trait-rfc/topic/Generator.20functions.20vs.20blocks.html">Generator functions vs blocks</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211435656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/249502-wg-async-foundations/stream-trait-rfc/topic/Generator%20functions%20vs%20blocks/near/211435656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sam Sartor <a href="https://rust-lang.github.io/zulip_archive/stream/249502-wg-async-foundations/stream-trait-rfc/topic/Generator.20functions.20vs.20blocks.html#211435656">(Sep 27 2020 at 21:37)</a>:</h4>
<p>I know I may be a bit late to the party, but I have a question about the gen syntax. Why gen functions rather than gen blocks? My understanding is that these generators would be an abstraction on coroutines (whether something like MCP-49 or not), in which case they can trivaly take construction arguments by capturing. What is the reason this proposal is focusing on explicit construction arguments first?</p>
<p>Just curious</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>